package com.eestimate.domain.impl;

import com.eestimate.dao.database.DBObject;
import com.eestimate.domain.Machine;
import com.eestimate.domain.business.BusinessObjectImpl;
import com.eestimate.domain.business.common.BusinessObjectTypeEnum;
import com.eestimate.domain.business.common.annotations.PersistentBusinessObject;
import com.eestimate.domain.business.common.annotations.PersistentMetadata;
import com.eestimate.valuesobjects.BaseDTO;
import com.eestimate.valuesobjects.MachineVo;

@PersistentBusinessObject(type=BusinessObjectTypeEnum.MACHINE)
public class MachineImpl extends BusinessObjectImpl implements Machine{

	public MachineImpl(DBObject dbObject) {
		super(dbObject);
	}
	
	@PersistentMetadata
	private String applicationPurpose;
	
	@PersistentMetadata
	private String machineType;
	
	@PersistentMetadata
	private String brand;
	
	@PersistentMetadata
	private String model;
	
	@PersistentMetadata
	private String origin;
	
	@PersistentMetadata
	private String fuelType;
	
	@PersistentMetadata
	private String runtime;
	
	@PersistentMetadata
	private String areaCoverage;
	
	@PersistentMetadata
	private String capacity;
	
	@PersistentMetadata
	private String companyUuid;

	@Override
	public String getApplicationPurpose() {
		return applicationPurpose;
	}

	@Override
	public void setApplicationPurpose(String applicationPurpose) {
		this.applicationPurpose = applicationPurpose;
	}

	@Override
	public String getMachineType() {
		return machineType;
	}

	@Override
	public void setMachineType(String machineType) {
		this.machineType = machineType;
	}

	@Override
	public String getBrand() {
		return brand;
	}

	@Override
	public void setBrand(String brand) {
		this.brand = brand;
	}

	@Override
	public String getModel() {
		return model;
	}

	@Override
	public void setModel(String model) {
		this.model = model;
	}

	@Override
	public String getOrigin() {
		return origin;
	}

	@Override
	public void setOrigin(String origin) {
		this.origin = origin;
	}

	@Override
	public String getFuelType() {
		return fuelType;
	}

	@Override
	public void setFuelType(String fuelType) {
		this.fuelType = fuelType;
	}

	@Override
	public String getRuntime() {
		return runtime;
	}

	@Override
	public void setRuntime(String runtime) {
		this.runtime = runtime;
	}

	@Override
	public String getAreaCoverage() {
		return areaCoverage;
	}

	@Override
	public void setAreaCoverage(String areaCoverage) {
		this.areaCoverage = areaCoverage;
	}

	@Override
	public String getCapacity() {
		return capacity;
	}

	@Override
	public void setCapacity(String capacity) {
		this.capacity = capacity;
	}

	@Override
	public String getCompanyUuid() {
		return companyUuid;
	}

	@Override
	public void setCompanyUuid(String companyUuid) {
		this.companyUuid = companyUuid;
	}

	@Override
	public BaseDTO createDTO(){
		MachineVo vo = new MachineVo();
		vo.name 	= this.getName();
		vo.type 	= this.getType();
		vo.uuid		= this.getUuid();
		
		vo.applicationPurpose 	= this.getApplicationPurpose();
		vo.machineType			= this.getMachineType();
		vo.brand				= this.getBrand();
		vo.model				= this.getModel();
		vo.origin				= this.getOrigin();
		vo.fuelType				= this.getFuelType();
		vo.runtime				= this.getRuntime();
		vo.areaCoverage			= this.getAreaCoverage();
		vo.capacity				= this.getCapacity();
		vo.companyUuid			= this.getCompanyUuid();
		
		return vo;
	}
}
